import { Injectable } from '@angular/core';
import { Http,Headers } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';

import { Search } from './search.model';

@Injectable()
export class SearchService {
	headers:Headers=new Headers();
	
	constructor(private http: Http) { }

	getList(type:string,keyWord:string): Observable<Search[]> {
		//this.headers.set("Access-Control-Allow-Origin","*");
		 return this.http.get('http://localhost:4200').map(res => res.json() as Search[]);
		// return this.http.get('api/list').map(res =>search,err => search)
	}
}